import thenFs from 'then-fs';

thenFs.readFile('./files/f1.txt', 'utf8')
    .then(res => {
        console.log('success--', res);
        return thenFs.readFile('./files/f2.txt', 'utf8');
    })
    .then(res => {
        console.log('success---', res);
        return thenFs.readFile('./files/f3.txt', 'utf8');
    })
    .then(res => {
        console.log('success----', res);
        return thenFs.readFile('./files/f4.txt', 'utf8');
    })
    //通过catch捕获其中的错误
    .catch(err => {
        console.log(err.message)
    });